package com.ms.oschina.adapter;

import java.util.List;

import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;

import com.ms.oschina.api.remote.OsChinaApi;
import com.ms.oschina.base.BaseViewHolder;
import com.ms.oschina.bean.Comment;
import com.ms.oschina.bean.CommentList;
import com.ms.oschina.viewholder.TweetCommentViewHolder;

public class TweetCommentAdapter extends PageIndexListAdapter<Comment> {

	private int id;

	public TweetCommentAdapter(int id, AbsListView listView,
			List<Comment> list, boolean loadMore) {
		super(listView, list, loadMore);
		this.id = id;
	}

	@Override
	public void onNormalItemClick(AdapterView<?> parent, View view,
			int position, long id) {
	}

	@Override
	public BaseViewHolder<Comment> getItemViewHolder() {
		return new TweetCommentViewHolder();
	}

	@Override
	public List<Comment> getLoadMoreData() throws Exception {
		CommentList commentList = OsChinaApi.getSyncTweetComment(id, pageIndex);
		return commentList.getCommentlist();
	}

}
